<?php


namespace app\Controllers;

use app\Models\PostModel;
use core\lib\Model;

class IndexController extends \core\h5cphp
{
    public function index()
    {
//        $post =  new PostModel();
//        dd($post->posts());
//        return;
//        $model = new Model();
//        dd($model->select('posts', "*"));
//        $sql = 'select * from posts';
//        $ret = $model->query($sql);
//        p($ret->fetchAll());
//        p(\core\Config::get('DEFAULT_CTRL', 'route'));
        //控制器渲染数据到视图
        $data = 'hello h5cphp';
        $this->assign('data', $data);
        //调用视图文件
        $this->view("index");

    }
    public function test()
    {
        //控制器渲染数据到视图
        $data = 'hello test';
        $this->assign('data', $data);
        //调用视图文件
        $this->view("test");

    }
}